package com.lc.afbx.conn;

import com.zcx.helper.http.AsyCallBack;
import com.zcx.helper.http.note.HttpInlet;

import org.json.JSONObject;

/**
 * Created by Administrator on 2016/12/27.
 */
@HttpInlet(Conn.API_INDEX_VERSIONS)
public class UpdateAppGet extends BaseAsyGet<UpdateAppGet.Info> {

    public UpdateAppGet(AsyCallBack<Info> asyCallBack) {
        super(asyCallBack);
    }

    @Override
    protected Info parser(JSONObject object) {

        TOAST = object.optString("message");

        if (object.optInt("code") == 200) {

            JSONObject mainObject = object.optJSONObject("data");

            Info info = new Info();

            info.number = mainObject.optInt("number");
            info.link = mainObject.optString("link");

            return info;
        }

        return null;
    }

    public static class Info {

        public String link;

        public int number;
    }
}
